package com.cy.pj.common.pojo;

import com.cy.pj.common.util工具类设计.PageUtil封装开启分页;
import com.github.pagehelper.ISelect;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 响应标准的设计
 */
@Data

public class JsonResult implements Serializable {
    private static final long serialVersionUID = -4971076199594828397L;
//构造方法类，通过new触发，方法重构，会自动识别参数类型往里面套

    private Integer state=1;
    private String message="Ok";
    private Object data;
    public JsonResult(){}

    public JsonResult(String message){
        this.message=message;
    }
    public JsonResult(Object data){
        this.data=data;
    }
    public JsonResult(Throwable e){
        this.state=0;
        this.message=e.getMessage();
    }
    //将分页启动的调用方法封装到响应标准中
//public JsonResult(ISelect select){
//this.data= PageUtil封装开启分页.startPage().doSelectPageInfo(select);


}

